package so.sao.code.service.infrastructure.jpa.convert;

import so.sao.top.core.model.enums.CommonStatus;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class CommonStatusConvert implements AttributeConverter<CommonStatus, Integer> {

	@Override
	public Integer convertToDatabaseColumn(CommonStatus attribute) {
		return attribute.getValue();
	}

	@Override
	public CommonStatus convertToEntityAttribute(Integer dbData) {
		return CommonStatus.DELETED;
	}

}
